package cn.gson.boot.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the category_ database table.
 * 
 */
@Entity
@Table(name="category_")
@NamedQuery(name="CategoryType.findAll", query="SELECT c FROM CategoryType c")
public class CategoryType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="FUNCTION_TYPE_TYPEID_GENERATOR", sequenceName="SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="FUNCTION_TYPE_TYPEID_GENERATOR")
	@Column(name="category_id")
	private long categoryId;

	@Column(name="category_rank")
	private String categoryRank;

	@Column(name="category_name")
	private String categoryName;

	//bi-directional many-to-one association to FunctionType
	@ManyToOne
	@JoinColumn(name="category_idt")
	private CategoryType categoryIdt;

	//bi-directional many-to-one association to FunctionType
	@OneToMany(mappedBy="categoryIdt")
	private List<CategoryType> categoryTypes;

	public CategoryType() {
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(long categoryId) {
		this.categoryId = categoryId;
	}

	public String getCategoryRank() {
		return categoryRank;
	}

	public void setCategoryRank(String categoryRank) {
		this.categoryRank = categoryRank;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public CategoryType getCategoryIdt() {
		return categoryIdt;
	}

	public void setCategoryIdt(CategoryType categoryIdt) {
		this.categoryIdt = categoryIdt;
	}

	public List<CategoryType> getCategoryTypes() {
		return categoryTypes;
	}

	public void setCategoryTypes(List<CategoryType> categoryTypes) {
		this.categoryTypes = categoryTypes;
	}

	public CategoryType addCategoryType(CategoryType categoryType) {
		getCategoryTypes().add(categoryType);
		categoryType.setCategoryIdt(this);

		return categoryType;
	}

	public CategoryType removeCategoryType(CategoryType categoryType) {
		getCategoryTypes().remove(categoryType);
		categoryType.setCategoryIdt(null);
		return categoryType;
	}

}